#include "EnvMapSample.h"
#include "Global.h"
#include "Basic/Stream.h"

namespace FinalRendering
{
	namespace Engine
	{
		EnvMapSample* EnvMapSample::FromEntity(IEntity * ent)
		{
			IBspEntity * bspEntity = dynamic_cast<IBspEntity*>(ent);
			if (bspEntity && wcscmp(ent->GetDesc()->ClassName(), L"EnvMapSample") == 0)
			{
				EnvMapSample * rs = new EnvMapSample();
				Volume vol;
				bspEntity->GetVolume(&vol);
				rs->Position = vol.Position;
				return rs;
			}
			return 0;
		}

	}
}